<?php
namespace app\common\model\account;
use app\common\model\CommonModel;

class AccountModel extends CommonModel{
    protected  $name = 'account';
    protected  $pk   = 'account_id';

    public function manageShop()
    {
        return $this->hasMany(ShopAccountModel::class,'account_id','account_id');
    }

    public function createShop()
    {
        return $this->hasMany(ShopAccountModel::class,'account_id','account_id');
    }

    public function getLastLoginTimeFormatAttr($value,$data)
    {
        return $data['last_login_time'] > 0 ? date('Y-m-d H:i:s',$data['last_login_time']) : '-';
    }
}
